package com.jzo2o.foundations.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 热点状态枚举
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum HotStatusEnum {
    NOT_HOT(0, "非热点"),
    HOT(1, "热点");

    // 添加@EnumValue注解，告诉MyBatis-Plus这是数据库映射字段
    @EnumValue
    private int isHot; // 枚举值
    private String description; // 枚举描述

    /**
     * 判断是否为指定热点状态值
     */
    public boolean equals(Integer isHot) {
        return this.isHot == isHot;
    }

    /**
     * 枚举值比较
     */
    public boolean equals(HotStatusEnum hotStatusEnum) {
        return hotStatusEnum != null && hotStatusEnum.isHot == this.getIsHot();
    }
}
